<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>

      //var声明的变量有变量提升(预解析)
      console.log(goods);  //undefined
      var goods = '华为手机';


      //let声明的变量没有变量提升(预解析)
     // console.log(tel);  //tel is not defined
      //let tel = 119;


      if(2){
        let uname = '悟空'
        if(3){
            //let有暂时性死区
            console.log(uname,'uname');  //uname is not defined
            let uname = '八戒';
           //console.log(uname,'uname');  //un
        }
      }


    </script>
</head>
<body>
    
</body>
</html>